#!/bin/sh

#
# Test that an mbr offset that requires a 32-bit unsigned int works
#

. "$(cd "$(dirname "$0")" && pwd)/common.sh"

cat >$CONFIG <<EOF
define(BOOT_PART_OFFSET, 4200000000)
define(BOOT_PART_COUNT, 77238)

mbr mbr-a {
    partition 0 {
        block-offset = \${BOOT_PART_OFFSET}
        block-count = \${BOOT_PART_COUNT}
        type = 0xc # FAT32
        boot = true
    }
}
task complete {
	on-init {
		mbr_write(mbr-a)
	}
}
EOF

# Try to create the firmware image
$FWUP_CREATE -c -f $CONFIG -o $FWFILE
